:root {
  --box-shadow-color: rgba(213, 224, 247, 1);
}

@keyframes avatarBounceBack {
  0% { transform: scale(1.6); }
  100% { transform: scale(1); }
}

@keyframes avatarBounce {
  0% { transform: scale(1.3); }
  70% { transform: scale(1.8); }
  100% { transform: scale(1.6); }
}

@keyframes avatarAnimate {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

@keyframes glowing {
  from { box-shadow: 0px 0px 10px 2px var(--box-shadow-color); }
  to { box-shadow: 0px 0px 10px 4px var(--box-shadow-color); }
}

.animate > span > div {
  animation-duration: var(--animation-speed-slow);
  animation-iteration-count: 1;
  animation-name: avatarAnimate;
  animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@for $i from 1 to 5 {
  .animate > span:nth-child($i) > div {
    animation-delay: calc(var(--animation-delay-standard) * $i);
  }
}

.avatarsHolder {
  align-items: center;
  display: flex;
  margin: 70px 0;
  justify-content: space-between;
  width: 100%;

  & div {
    position: relative;
    z-index: 1;
  }

  & > span {
    animation-direction: normal;
    animation-timing-function: linear;
    background: transparent;
    cursor: pointer;
    display: flex;
    border-radius: 50%;
    position: relative;
    transition:
      opacity var(--animation-speed-fast) ease-in,
      transform var(--animation-speed-fast) linear;

    &::before,
    &::after {
      border-radius: 50%;
      content: '';
      height: 100%;
      left: 0;
      position: absolute;
      transition: transform var(--animation-speed-fast) ease-in-out;
      top: 0;
      width: 100%;
    }

    &::before {
      transform: scale(0.9, 0.9);
      background: var(--color-white);
      border: 1px solid var(--color-ultramarine-blue);
      z-index: 0;
    }

    &::after {
      z-index: -2;
    }

    &:hover {
      opacity: 1 !important;
    }

    &.deselect {
      /* animation-name: avatarBounceBack; */
      animation-duration: var(--animation-speed-fast);
      animation-iteration-count: 1;
    }

    &.selected {
      /* animation-name: avatarBounce; */
      animation-duration: var(--animation-speed-standard);
      animation-fill-mode: both;
      animation-iteration-count: 1;

      &::before,
      &::after {
        transform: scale(1.3);
        transition: transform var(--animation-speed-fast) ease-in-out;
      }
    }
  }
}
